package cn.teacher.dao;

import cn.teacher.pojo.Teacher;
import cn.teacher.pojo.dto.TeacherDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface TeacherDaoMapper {

    /**
     * 删除老师
     * @param userId
     * @return
     */
    int delete(@Param("userId") long userId);

    /**
     * 查询老师的扩展信息
     * @param userId
     * @return
     */
    TeacherDTO select(@Param("userId") long userId);

    /**
     * 使用id查询用户数量
     * @param userId
     * @return
     */
    int countById(@Param("userId") long userId);

    /**
     * 添加用户
     * @return
     */
    int insert(Teacher teacher);

    /**
     * 修改用户
     * @param teacher
     * @return
     */
    int update(Teacher teacher);

}
